Kinetis SDK API Reference Manual  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Power Management Controller (PMC)

The Kinetis SDK provides a HAL driver for the Power Management Controller (PMC) block of Kinetis devices. More...

Enumerations

enum  pmc_lvwv_select_t {
  kPmcLvwvLowTrip,
  kPmcLvwvMid1Trip,
  kPmcLvwvMid2Trip,
  kPmcLvwvHighTrip
}
 Low-Voltage Warning Voltage Select. More...
 
enum  pmc_lvdv_select_t {
  kPmcLvdvLowTrip,
  kPmcLvdvHighTrip
}
 Low-Voltage Detect Voltage Select. More...
 

Power Management Controller Control APIs

static void pmc_hal_enable_low_voltage_detect_interrupt (void)
 Low-Voltage Detect Interrupt Enable. More...
 
static void pmc_hal_disable_low_voltage_detect_interrupt (void)
 Low-Voltage Detect Interrupt Disable (use polling) More...
 
static void pmc_hal_enable_low_voltage_detect_reset (void)
 Low-Voltage Detect Hardware Reset Enable (write once) More...
 
static void pmc_hal_disable_low_voltage_detect_reset (void)
 Low-Voltage Detect Hardware Reset Disable. More...
 
static void pmc_hal_low_voltage_detect_ack (void)
 Low-Voltage Detect Acknowledge. More...
 
static bool pmc_hal_get_low_voltage_detect_flag (void)
 Low-Voltage Detect Flag Read. More...
 
static void pmc_hal_set_low_voltage_detect_voltage_select (pmc_lvdv_select_t select)
 Sets the Low-Voltage Detect Voltage Select. More...
 
static pmc_lvdv_select_t pmc_hal_get_low_voltage_detect_voltage_select (void)
 Gets the Low-Voltage Detect Voltage Select. More...
 
static void pmc_hal_enable_low_voltage_warning_interrupt (void)
 Low-Voltage Warning Interrupt Enable. More...
 
static void pmc_hal_disable_low_voltage_warning_interrupt (void)
 Low-Voltage Warning Interrupt Disable (use polling) More...
 
static void pmc_hal_low_voltage_warning_ack (void)
 Low-Voltage Warning Acknowledge. More...
 
static bool pmc_hal_get_low_voltage_warning_flag (void)
 Low-Voltage Warning Flag Read. More...
 
static void pmc_hal_set_low_voltage_warning_voltage_select (pmc_lvwv_select_t select)
 Sets the Low-Voltage Warning Voltage Select. More...
 
static pmc_lvwv_select_t pmc_hal_get_low_voltage_warning_voltage_select (void)
 Gets the Low-Voltage Warning Voltage Select. More...
 
static void pmc_hal_enable_bandgap_buffer (void)
 Enables the Bandgap Buffer. More...
 
static void pmc_hal_disable_bandgap_buffer (void)
 Disables the Bandgap Buffer. More...
 
static uint8_t pmc_hal_get_ack_isolation (void)
 Gets the Acknowledge Isolation. More...
 
static void pmc_hal_clear_ack_isolation (void)
 Clears an Acknowledge Isolation. More...
 
static uint8_t pmc_hal_get_regulator_status (void)
 Gets the Regulator regulation status. More...
 

PMC HAL driver

Overview

The power management controller (PMC) contains the internal voltage regulator, power on reset (POR), and low voltage detect system.The pmc_hal provides a set of APIs used to access the control registers including enable/disable features provided by this module.

Power Management Controller feature access APIs

  1. Internal voltage regulator
  2. Active POR providing brown-out detect
  3. Low-voltage detect supporting two low-voltage trip points with four warning levels per trip point
This is an example of PMC HAL access APIs
#include "pmc/hal/fsl_pmc_hal.h"
// Low-Voltage Detect Interrupt Enable
// Low-Voltage Detect Interrupt Disable (use polling)
// Set Low-Voltage Detect Voltage Select to Low trip point (V LVD = V LVDL )

Enumeration Type Documentation

Enumerator
kPmcLvwvLowTrip 

Low trip point selected (VLVW = VLVW1)

kPmcLvwvMid1Trip 

Mid 1 trip point selected (VLVW = VLVW2)

kPmcLvwvMid2Trip 

Mid 2 trip point selected (VLVW = VLVW3)

kPmcLvwvHighTrip 

High trip point selected (VLVW = VLVW4)

Enumerator
kPmcLvdvLowTrip 

Low trip point selected (V LVD = V LVDL )

kPmcLvdvHighTrip 

High trip point selected (V LVD = V LVDH )

Function Documentation

static void pmc_hal_enable_low_voltage_detect_interrupt ( void  )
inlinestatic

This function enables the interrupt for the low voltage detection. When enabled, if the LVDF (Low Voltage Detect Flag) is set, a hardware interrupt occurs.

static void pmc_hal_disable_low_voltage_detect_interrupt ( void  )
inlinestatic

This function disables the the interrupt for low voltage detection. When disabled, an application can only check the low voltage through polling the LVDF (Low Voltage Detect Flag).

static void pmc_hal_enable_low_voltage_detect_reset ( void  )
inlinestatic

This function enables the hardware reset for the low voltage detection. When enabled, if the LVDF (Low Voltage Detect Flag) is set, a hardware reset occurs. This setting is a write-once-only; Additional writes are ignored.

static void pmc_hal_disable_low_voltage_detect_reset ( void  )
inlinestatic

This function disables the the hardware reset for low voltage detection. When disabled, if the LVDF (Low Voltage Detect Flag) is set, a hardware reset does not occur. This setting is a write-once-only; Additional writes are ignored.

static void pmc_hal_low_voltage_detect_ack ( void  )
inlinestatic

This function acknowledges the low voltage detection errors (write 1 to clear LVDF).

static bool pmc_hal_get_low_voltage_detect_flag ( void  )
inlinestatic

This function reads the current LVDF status. If it returns 1, low voltage event is detected.

Returns
status Current low voltage detect flag
  • true: Low-Voltage detected
  • false: Low-Voltage not detected
static void pmc_hal_set_low_voltage_detect_voltage_select ( pmc_lvdv_select_t  select)
inlinestatic

This function sets the low voltage detect voltage select. It sets the low voltage detect trip point voltage (Vlvd). An application can select either a low-trip or a high-trip point. See a chip reference manual for details.

Parameters
selectVoltage select setting defined in pmc_lvdv_select_t
static pmc_lvdv_select_t pmc_hal_get_low_voltage_detect_voltage_select ( void  )
inlinestatic

This function gets the low voltage detect voltage select. It gets the low voltage detect trip point voltage (Vlvd). An application can select either a low-trip or a high-trip point. See a chip reference manual for details.

Returns
select Current voltage select setting
static void pmc_hal_enable_low_voltage_warning_interrupt ( void  )
inlinestatic

This function enables the interrupt for the low voltage warning detection. When enabled, if the LVWF (Low Voltage Warning Flag) is set, a hardware interrupt occurs.

static void pmc_hal_disable_low_voltage_warning_interrupt ( void  )
inlinestatic

This function disables the interrupt for the low voltage warning detection. When disabled, if the LVWF (Low Voltage Warning Flag) is set, a hardware interrupt does not occur.

static void pmc_hal_low_voltage_warning_ack ( void  )
inlinestatic

This function acknowledges the low voltage warning errors (write 1 to clear LVWF).

static bool pmc_hal_get_low_voltage_warning_flag ( void  )
inlinestatic

This function polls the current LVWF status. When 1 is returned, it indicates a low-voltage warning event. LVWF is set when V Supply transitions below the trip point or after reset and V Supply is already below the V LVW.

Returns
status Current LVWF status
  • true: Low-Voltage Warning Flag is set.
  • false: the Low-Voltage Warning does not happen.
static void pmc_hal_set_low_voltage_warning_voltage_select ( pmc_lvwv_select_t  select)
inlinestatic

This function sets the low voltage warning voltage select. It sets the low voltage warning trip point voltage (Vlvw). An application can select either a low, mid1, mid2 and a high-trip point. See a chip reference manual for details and the pmc_lvwv_select_t for supported settings.

Parameters
selectLow voltage warning select setting
static pmc_lvwv_select_t pmc_hal_get_low_voltage_warning_voltage_select ( void  )
inlinestatic

This function gets the low voltage warning voltage select. It gets the low voltage warning trip point voltage (Vlvw). See the pmc_lvwv_select_t for supported settings.

Returns
select Current low voltage warning select setting
static void pmc_hal_enable_bandgap_buffer ( void  )
inlinestatic

This function enables the Bandgap buffer.

static void pmc_hal_disable_bandgap_buffer ( void  )
inlinestatic

This function disables the Bandgap buffer.

static uint8_t pmc_hal_get_ack_isolation ( void  )
inlinestatic

This function reads the Acknowledge Isolation setting that indicates whether certain peripherals and the I/O pads are in a latched state as a result of having been in the VLLS mode.

Returns
value ACK isolation 0 - Peripherals and I/O pads are in a normal run state. 1 - Certain peripherals and I/O pads are in an isolated and latched state.
static void pmc_hal_clear_ack_isolation ( void  )
inlinestatic

This function clears the ACK Isolation flag. Writing one to this setting when it is set releases the I/O pads and certain peripherals to their normal run mode state.

static uint8_t pmc_hal_get_regulator_status ( void  )
inlinestatic

This function returns the regulator to a run regulation status. It provides the current status of the internal voltage regulator.

Returns
value Regulation status 0 - Regulator is in a stop regulation or in transition to/from it. 1 - Regulator is in a run regulation.